1. Field of the Invention
The present invention relates to a computer incorporating a UNIX-based operating system such as Linux, BSD, SystemV or OS-9 based on UNIX design concepts or other multitasking operating system having a command interpreter, and to a storage medium containing a function command program executable on such a computer.
2. Description of the Prior Art
UNIX (herein including Linux) is one of the most widespread operating systems, and includes a program called “kernel” which controls the most fundamental portion thereof, and an interactive command interpreter called “shell”. When a user inputs a desired command from an input terminal such as a keyboard in response to a shell prompt to cause a computer to perform a desired operation, the shell interprets the inputted command to execute the command.
UNIX incorporates a variety of commands as standard. With UNIX, some of the basic commands are combined to create new commands for performing a little more complicated tasks, and these commands are further combined to create a command for performing a more advanced task. Conventionally, such an operation is widely performed by utilizing a shell script.
The shell script utilizes existing commands as elements of a high-level programming language for programming. The shell script is a file in which a set of commands are described, and serves as a program for providing instructions to the shell. In a UNIX shell script, an iteration statement and a branch statement can be used. Where a bash shell is employed, a function can be defined in the script. Therefore, the bash shell allows for shell programming comparable to programming in a high-level programming language such as C language, though the execution speed thereof is still unsatisfactory. Where the execution speed is not critical, UNIX programming is achieved by first creating a shell script and programming commands required to be executed at a high speed for larger size data processing in C language.
As described above, the bash shell allows for the function definition, thereby ensuring easier and sophisticated programming. However, a shell script incorporating the function definition cannot be used in other shells such as a Bourne shell (sh) and a C shell (csh).
In the case of the shell script, the iteration statement and the branch statement are implemented by a program incorporated in the shell, and the incorporated program is executed through a process of the shell script. Therefore, forceful exit from the program of these flow control statements (e.g., forceful termination by typing “^D”) means forceful termination of the process executing the shell script program. Where the user is performing an operation with the use of the shell script, he may desire to forcefully exit from a loop programmed in the shell script and then continue to execute a command described therein. In the prior art shell programming, however, a flow control scheme for exiting from the loop should preliminarily be programmed in consideration of the above case.
It is therefore an object of the present invention to provide a programming environment based on a novel concept by implementing a function as a shell external command. It is another object of the invention to create a sophisticated program incorporating function definition without any additional feature of a shell used by a user, and to achieve programming in the same manner as in C language without modifying a conventional shell such as sh or sch. It is further another object of the invention to achieve flexible and powerful multitasking programming by taking advantage of all the features of an operating system available to the user.